package utils;

import java.awt.Component;
import java.awt.KeyboardFocusManager;
import java.awt.event.KeyEvent;

public class KeyboardManager {


	//@author A0098891H
	public static void genKeyEvent(int keyevent, int keyMask,int keyCode)
	{
		KeyboardFocusManager keyMan = KeyboardFocusManager.getCurrentKeyboardFocusManager();
        Component comp = keyMan.getFocusOwner();
        KeyEvent event = new KeyEvent(comp, 
        		keyevent, System.currentTimeMillis(), keyMask, 
        		keyCode, KeyEvent.CHAR_UNDEFINED);
        comp.dispatchEvent(event);
	}

}
